package game.ghostleg;

import java.io.Serializable;

public class PlayerInfo implements Serializable {
	// player Name
	public String playerName;
	public int score;
	// player ID
	public int playerID;
	public PlayerInfo() {
		this.playerName="";
		this.playerID=-1;
	}
	
	public PlayerInfo ( String p_str, int p_id ) {
		this.playerName = p_str;
		this.playerID = p_id;
	}
	
	public PlayerInfo ( String p_str, int p_id, int p_score ) {
		this.playerName = p_str;
		this.playerID = p_id;
		this.score = p_score;
	}
	
	public String getName() {
		return playerName;
	}
	public int getPlayerID() {
		return playerID;
	}
	public boolean credit (Item item) {
		switch ( item.getType() ) {
			case 0:
				break;
			case 1:
				break;
			case 2:
				this.score += item.getValue();
				break;
			case 3:
				this.score *= (int)(1+item.getValue()/100.0);
				break;
		}
		return true;
	}
	public int getScore() {
		return this.score;
	}
}
